package com.fengfeng.channel;

import android.app.Activity;
import com.fengfeng.ChannelSDK;
import com.fengfeng.PlatformCallback;

/**
 * @author xiaoguokeng
 * @Date 2024/9/4
 */
public class PlatformSDK {

    private static PlatformSDK mInstance;

    private PlatformSDK() {
    }

    //单例模式，获取唯一的SDK对象，单例模式，就是用来保证只有一个对象产生。
    public static PlatformSDK getInstance() {
        if (mInstance == null) {
            mInstance = new PlatformSDK();
        }
        return mInstance;
    }

    /**
     * 初始化接口
     */
    public void init(PlatformCallback callback) {
        ChannelSDK.getInstance().init(callback);
    }

    /**
     * 登录接口
     */
    public void login() {
        ChannelSDK.getInstance().login();
    }

    /**
     * 账号登出接口
     */
    public void logout() {
        ChannelSDK.getInstance().logout();
    }

    public void onCreate(Activity activity) {
        ChannelSDK.getInstance().onCreate(activity);
    }

    public void onDestroy() {
        ChannelSDK.getInstance().onDestroy();
    }

    public void onResume() {
        ChannelSDK.getInstance().onResume();
    }

    public void onRestart() {
        ChannelSDK.getInstance().onRestart();
    }

    public void onBackPressed() {
        ChannelSDK.getInstance().onBackPressed();
    }
}
